import 'package:flutter/material.dart';
import 'JoystickWidget.dart';

class JoystickPage extends StatefulWidget {
  const JoystickPage({super.key});

  @override
  State<JoystickPage> createState() => _JoystickPageState();
}

class _JoystickPageState extends State<JoystickPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: const Text('JoystickPage')),
        body: Center(
            child: Container(child: JoystickWidget(
              zoneR: 120,
              //外层大小
              handleR: 18,
              //摇杆大小
              onHandleListener: (direction) {
                print('JtTag:direction:${direction}');
              },
              //外层颜色
              backgroundColor: Colors.white,
              //边框颜色
              borderColor: Colors.grey,
              //方向颜色
              buttonColor: Colors.black,
              //摇杆颜色
              centerColor: Colors.brown,

              isActivate: true,
              isSupportVertical: true,
              isSupportHorizontal: false,
              isSupport: false,
            ),)));
  }
}
